package org.ccahouse.ccatrain.controller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.ccahouse.ccacommons.base.BaseController;
import org.ccahouse.ccacommons.common.RestResult;
import org.ccahouse.ccatrain.dto.UserListPageDto;
import org.ccahouse.ccatrain.entity.User;
import org.ccahouse.ccatrain.service.IUserService;
import org.ccahouse.ccatrain.service.TrainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 描述：
 *
 * @author kevin
 * @since 2020-07-04
 */
@RestController
@RequestMapping("/train")
@Api(tags = "培训实例")
public class TrainController extends BaseController {

    @Autowired
    private TrainService trainService;

    @GetMapping("/hello/{name}")
    public String sayHello(@PathVariable String name) {
        return "hello " + name;
    }

    @GetMapping("/hello")
    public String sayHello1(@RequestHeader("name") String name) {
        return "hello " + name;
    }

    @GetMapping("/hello1")
    public String sayHello2(@RequestParam("name") String name) {
        return "hello " + name;
    }

    @GetMapping("/hello3/{i}")
    public String sayHello3(@PathVariable int i) {
        return trainService.sayHello(i);
    }


}
